package com.motherchild.admin.mapper;

import com.motherchild.admin.dto.CartDTO;
import com.motherchild.admin.dto.OrderDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper {
    List<OrderDTO> selectOrders(@Param("offset") int offset, @Param("limit") int limit);
    int countOrders();
    void insertOrder(OrderDTO orderDTO);
    void updateOrder(OrderDTO orderDTO);
    void deleteOrder(Integer id);
    OrderDTO selectOrderById(Integer id);

    CartDTO selectOrderWithItems(Integer id);

    void deleteOrderDeitem(Integer id);

    List<OrderDTO> selectUserOrders(int offset, int limit, Integer userId);
}
